<h2>Usuarios</h2>
<p id="page-intro">Administraci&oacute;n</p>

<!-- Begin Opciones -->
<ul class="shortcut-buttons-set">

    <li>
        <a class="shortcut-button" href="/admin/users/add">
            <span>
                <img src="/resources/admin/images/icons/add-user_48.png" alt="icon" /><br />
                Agregar Usuario
            </span>
        </a>
    </li>
    <li>
        <a class="shortcut-button" href="/admin/users/search">
            <span>
                <img src="/resources/admin/images/icons/search_48.png" alt="icon" /><br />
                Buscar Usuario
            </span>
        </a>
    </li>
</ul>
<!-- END Opciones -->

<div class="clear"></div> <!-- End .clear -->
<!-- BEGIN Success-->
<?php echo $this->partial('partials/success.phtml', 'admin', array('success' => $this->success)); ?>
<!-- END Success -->
<!-- BEGIN Success-->
<?php echo $this->partial('partials/error.phtml', 'admin', array('errors' => $this->errors)); ?>
<!-- END Success -->
<!-- BEGIN Success-->
<?php echo $this->partial('partials/information.phtml', 'admin', array('information' => $this->information)); ?>
<!-- END Success -->

<div class="content-box">

    <div class="content-box-header">
        <h3>Buscar Usuarios</h3>
    </div>

    <div class="content-box-content">

        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->

            <div class="admin-navigation">
                | <a href="/admin/users/">&lt; Regresar</a> |
            </div>

            <div id="admin-form">
                <?php echo $this->form; ?>
            </div>

            <?php if (isset($this->users) && count($this->users)) {
 ?>
                    <table>

                        <thead>
                            <tr>
                                <th>Imagen</th>
                                <th>Nombre</th>
                                <th>Usuario</th>
                                <th>Correo</th>
                                <th>Rol</th>
                                <th>Operaciones</th>
                            </tr>

                        </thead>

                        <tfoot>
                            <tr>
                                <td colspan="6">

                                    <!-- BEGIN Pagination -->
                            <?php if (isset($this->paginator))
                                echo $this->partial('partials/pagination.phtml', 'admin', array('paginator' => $this->paginator, 'url' => $this->urlPagination)); ?>
                            <!-- END Pagination -->

                            <div class="clear"></div>
                        </td>
                    </tr>
                </tfoot>

                <tbody>

                    <?php
                            if (count($this->users) > 0) {
                                foreach ($this->users as $user) {
                    ?>

                                    <tr>
                                        <td><img src="<?php echo $this->showUserImage($user['username']); ?>" alt="" width="32px;" height="32px;"/></td>
                                        <td><?php echo $user['fullname'] ?></td>
                                        <td><?php echo $user['username'] ?></td>
                                        <td><?php echo $user['email'] ?></td>
                                        <td><?php echo $user['role'] ?></td>
                                        <td>
                                            <!-- Icons -->
                                            <a href="/admin/users/edit/user/<?php echo $user['userid']; ?>" title="Edit"><img src="/resources/admin/images/icons/pencil.png" alt="Edit" /></a>
                                            <a href="/admin/users/delete/user/<?php echo $user['userid']; ?>" title="Delete" class="ask"><img src="/resources/admin/images/icons/cross.png" alt="Delete" /></a>
                                            <a href="/admin/users/image/user/<?php echo $user['userid']; ?>" title="Editar Imagen"><img src="/resources/images/icons/image_edit-16x16.png" alt="Delete" /></a>
                                        </td>
                                    </tr>
<?php }
                            } else { ?>
                                <tr>
                                    <td colspan="7">
                                        <!-- attention -->
<?php echo $this->partial('partials/attention.phtml', 'admin', array('attention' => $this->attention)); ?>
                                <!-- attention -->
                            </td>
                        </tr>
<?php } ?>
                        </tbody>


                    </table>

<?php } // end main IF  ?>

        </div> <!-- End #tab1 -->



    </div> <!-- End .content-box-content -->
</div>